package org.example.application;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.domain.model.entity.url.req.UrlShortenerGroupSortReq;
import org.example.domain.model.entity.url.req.UrlShortenerUpdateGroupReq;
import org.example.domain.model.entity.url.resp.UrlShortenerGroupResp;
import org.example.domain.model.service.url.UrlGroupDomainService;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
@Slf4j
public class UrlGroupService {
    private final UrlGroupDomainService urlGroupDomainService;

    public void saveGroup(String groupName, String userName) {
        urlGroupDomainService.saveGroup(groupName, userName);
    }

    public List<UrlShortenerGroupResp> listGroup(String userName) {
        return urlGroupDomainService.listGroup(userName);
    }

    public void updateGroup(UrlShortenerUpdateGroupReq req, String userName) {
        urlGroupDomainService.updateGroup(req, userName);
    }

    public void deleteGroup(String gid, String userName) {
        urlGroupDomainService.deleteGroup(gid, userName);
    }

    public void sortGroup(List<UrlShortenerGroupSortReq> reqList, String userName) {
        urlGroupDomainService.sortGroup(reqList, userName);
    }

    public List<String> selectGitListByUserName(String userName) {
        return urlGroupDomainService.selectGitListByUserName(userName);
    }
}
